package logic

import (
	"context"
	"videos/model/mysql"

	"videos/videorpc/internal/svc"
	"videos/videorpc/videorpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type CollectionListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCollectionListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CollectionListLogic {
	return &CollectionListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CollectionListLogic) CollectionList(in *videorpc.CollectionListRequest) (*videorpc.CollectionListResponse, error) {
	// todo: add your logic here and delete this line

	var list []*videorpc.CollectionList

	list = mysql.CollectionList(mysql.DB, (*videorpc.CommentListRequest)(in))

	return &videorpc.CollectionListResponse{
		List: list,
	}, nil
}
